package com.jzy.bxb.app.manager;

import com.jzy.bxb.model.mongo.entity.Address;

/**
 * 订单
 *
 * @author JiangZhiYong
 * @date 2017-07-13 QQ:359135103
 */
public class OrderManager {
	private static volatile OrderManager orderManager;

	private OrderManager() {

	}

	public static OrderManager getInstance() {
		if (orderManager == null) {
			synchronized (OrderManager.class) {
				if (orderManager == null) {
					orderManager = new OrderManager();
				}
			}
		}
		return orderManager;
	}

	/**
	 * redis 地址field
	 * 
	 * @param address
	 * @return
	 * @author JiangZhiYong
	 * @date 2017-07-13 QQ:359135103
	 */
	public String getRedisAddressStr(Address address) {
		StringBuilder sb = new StringBuilder(address.getCity()).append(".");
		sb.append(address.getCounty()).append(".").append(address.getCommunity());
		return sb.toString();
	}
}
